// This makes a list of our custom locales
// Its just for the input control

using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
 
namespace customcldr
{
    class CldrLocaleList : ArrayList
    {
        static internal CldrLocaleList LocaleList = null;

        string strLocalizedLocale = null;
        static CldrLocale english = null;

        public CldrLocaleList(string strDisplayLocaleName)
        {
            LocaleList = this;
            strLocalizedLocale = strDisplayLocaleName;
        }

        public CldrLocale GetLocale(string strName)
        {
            for (int i = 0; i < this.Count; i++)
            {
                CldrLocale test = (CldrLocale) this[i];
                if (test.strLocaleName == strName)
                {
                    return test;
                }
            }

            return null;
        }

        static public CldrLocale English
        {
            get
            {
                if (english==null)
                    english = CldrLocaleList.LocaleList.GetLocale("en");
                return english;
            }
        }

        public CldrLocale Localized
        {
            get
            {
                return GetLocale(strLocalizedLocale);
            }
        }

        public string LocalizedLanguageName
        {
            get
            {
                return strLocalizedLocale;
            }
        }
    }
}
